{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/App.tsx\",\n  _s = $RefreshSig$();\nimport React from 'react';\nimport Title from \"./utils/Title\";\nimport { Context } from \"./index\";\nimport { observer } from \"mobx-react-lite\";\nimport { Route, Routes, useNavigate } from \"react-router-dom\";\nimport { Auth, Im } from \"./pages\";\nimport { browserRouteAuth, browserRouteIm } from \"./routes\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst App = () => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  const navigate = useNavigate();\n  Title();\n  React.useEffect(() => {\n    if (localStorage.getItem(`${process.env.REACT_APP_NAME_TOKEN}`)) {\n      store.checkAuth();\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n  React.useEffect(() => {\n    store.getAuth() ? navigate(browserRouteIm) : navigate(browserRouteAuth);\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [store.getAuth()]);\n  if (store.getLoading()) {\n    return /*#__PURE__*/_jsxDEV(\"section\", {\n      children: /*#__PURE__*/_jsxDEV(\"div\", {\n        children: \"\\u0417\\u0430\\u0433\\u0440\\u0443\\u0437\\u043A\\u0430...\"\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 30,\n        columnNumber: 17\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 29,\n      columnNumber: 13\n    }, this);\n  }\n  return /*#__PURE__*/_jsxDEV(Routes, {\n    children: [/*#__PURE__*/_jsxDEV(Route, {\n      path: browserRouteAuth,\n      element: /*#__PURE__*/_jsxDEV(Auth, {}, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 37,\n        columnNumber: 51\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 37,\n      columnNumber: 11\n    }, this), /*#__PURE__*/_jsxDEV(Route, {\n      path: browserRouteIm,\n      element: /*#__PURE__*/_jsxDEV(Im, {}, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 38,\n        columnNumber: 49\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 38,\n      columnNumber: 11\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 36,\n    columnNumber: 7\n  }, this);\n};\n_s(App, \"4DJSNuQ5ndHPXNKdkI/hys3btiA=\", false, function () {\n  return [useNavigate];\n});\n_c = App;\nexport default _c2 = observer(App);\nvar _c, _c2;\n$RefreshReg$(_c, \"App\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","Title","Context","observer","Route","Routes","useNavigate","Auth","Im","browserRouteAuth","browserRouteIm","App","store","useContext","navigate","useEffect","localStorage","getItem","process","env","REACT_APP_NAME_TOKEN","checkAuth","getAuth","getLoading"],"sources":["/data/messenger.client/src/App.tsx"],"sourcesContent":["import React, {FC} from 'react';\nimport Title from \"./utils/Title\";\nimport {Context} from \"./index\";\nimport {observer} from \"mobx-react-lite\";\nimport {Route, Routes, useNavigate} from \"react-router-dom\";\nimport {Auth, Im} from \"./pages\";\nimport {browserRouteAuth, browserRouteIm} from \"./routes\";\n\nconst App: FC = () => {\n    const {store} = React.useContext(Context);\n    const navigate = useNavigate();\n\n    Title();\n\n    React.useEffect( () => {\n        if (localStorage.getItem(`${process.env.REACT_APP_NAME_TOKEN}`)) {\n            store.checkAuth();\n        }\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, []);\n\n    React.useEffect( () => {\n        (store.getAuth())? navigate(browserRouteIm): navigate(browserRouteAuth);\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [store.getAuth()]);\n\n    if (store.getLoading()) {\n        return (\n            <section>\n                <div>Загрузка...</div>\n            </section>\n        )\n    }\n\n    return (\n      <Routes>\n          <Route path={browserRouteAuth} element={<Auth />} />\n          <Route path={browserRouteIm} element={<Im />} />\n      </Routes>\n    );\n}\n\nexport default observer(App);\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAY,OAAO;AAC/B,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